<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
  <title>Formatter and colorer of raw JSON code</title>  


<script src="assets/scripts/weixin/checkJson.js"></script>  
<script>  
window.onbeforeunload = onbeforeunload_handler;
window.onunload = onunload_handler;
function onbeforeunload_handler() {
    var warning = "exit1?";
    return warning;
}

function onunload_handler() {
    var warning = "exit2?";
    alert(warning);
}     
</script>
</head>  

<a href="http://www.baidu.com">link</a>
</body>  
</html>  